package com.mobike.android.os

import com.android.basic.androidApp


val currentProcessName: String? by lazy {
  val pid = android.os.Process.myPid()
  var res: String? = null
  for (appProcess in androidApp.activityManager.runningAppProcesses) {
    if (appProcess.pid == pid) {
      res = appProcess.processName
    }
  }
  res
}

fun isMainProcess(): Boolean = androidApp.packageName == currentProcessName




